package com.example.androidcomplete0102.ch19;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.example.androidcomplete0102.R;

public class LongTime1 extends Activity {
	int mValue;
	TextView tv;
	
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.ch19_uploadex);
		tv = (TextView)findViewById(R.id.ch19_text);
		
	}
	
	public void mOnClick(View v){
		mValue = 0;
		upDate();
	}

	private void upDate() {
		for(int i=0; i<100; i++){
			mValue++;
			tv.setText(Integer.toString(mValue));
			try {Thread.sleep(50);} catch (InterruptedException e) {e.printStackTrace();}
			
		}
	}
	
}
